<?php
/**
 * Created by PhpStorm.
 * User: haobin
 * Date: 2016/9/23
 * Time: 9:37
 */
require_once('conn.php');
require_once('functions.php');
$uid = $_GET['id'];
$txInfo = $mysql->query("select * from `txdata` WHERE `uid` = {$uid}");
?>
<html>
<head>
    <meta charset="UTF-8">
    <title>微有趣</title>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <link rel="stylesheet" type="text/css" href="./assets/css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="./assets/css/recode.css"/>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script>
        function changeSize() {
            var propo = $(window).width() / 640;
            $('html').css('font-size', 40 * propo + 'px');
        }
        ;
        changeSize();
        $(window).resize(function () {
            changeSize();
        });
    </script>
</head>
<body>
<div class="wrap">
    <header>
        <ul class="nav clearfix">
            <li>兑换商品</li>
            <li>兑换时间</li>
            <li>状态</li>
        </ul>
    </header>
    <div class="con">
        <ul>
            <?php foreach ($txInfo as $info):
                $state = $info['state'];
                if ($state == 1) {
                    $stateClass = "state1";
                    $stateSpan = "等待提现";
                } elseif ($state == 2) {
                    $stateClass = "state2";
                    $stateSpan = "已提现";
                } else{
                    $stateClass = "state3";
                    $stateSpan = "已退回余额";
                }
                    ?>
                    <li>
                        <span class="goods"><?= $info['money']?>元红包</span><span class="time"><?=$info['payday']?></span><span
                            class="<?= $stateClass?>"><?= $stateSpan?></span>
                    </li>
                <?php endforeach ?>
        </ul>
    </div>
</div>
</body>
</html>

